<?php
namespace App\Repositories;

use App\Exceptions\BasicException;
use Illuminate\Support\Facades\Hash;
use function Matrix\add;    //引入hash

class MallProductsPriceRepository
{
    /**
     * 一键新增产品价格
     * @param $param
     * @return bool
     *@throws BasicException
     */
    public function  addProductPrice($param){
        $add = app('model_mall_products_price')->insert($param);
        if ($add)  return  $add;
        throw new BasicException(93107);
    }

    /**
     * 编辑产品价格
     * @param $param
     */
    public function  saveProductPrice($param){
       app('model_mall_products_price')->where('id',$param['id'])->update($param);
    }

    /**
     * 删除产品价格
     * @param $param
     */
    public function  delProductPrice($param){
        app('model_mall_products_price')->whereIn('product_id',$param)->delete();
    }

}
?>